package web.Positiontype;

import com.google.gson.Gson;
import entity.CourtsBean;
import entity.PositiontypeBean;
import services.CourtsServiceAll;
import services.PositiontypeService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
@WebServlet("/getpositiontypeAll")
public class GetpositiontypeAll extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setContentType("application/json");
        List<PositiontypeBean> list = new PositiontypeService().getpositiontypeAll();
        Gson gson = new Gson();
        String json = gson.toJson(list);
        resp.getWriter().println(json);
    }
}
